package com.lx.nonameclass;

public class test {
    public static void main(String[] args) {
        new Student(){

            @Override
            public void study() {
                System.out.println("重写接口的内部类");
            }
        };


        mothed(
                //内部类可看做对象传递给mothed方法
                new teacher(){
                    @Override
                    public void teach() {
                        System.out.println("实现抽象方法的内部类");
                    }
                }
        );

    }

    public static void mothed(teacher t)
    {
        t.teach();
    }
}
